<template>
	<view class="income-certificate">
		<view class="header-fixed-box">
			<u-tabs bg-color="transparent" height="90" :gutter="0" bar-width="80" bar-height="4" :bar-style="{'border-radius':'2rpx'}" font-size="32" active-color="#1F78FF" inactive-color="#999" :list="tabList" :item-width="100/tabList.length+'%'" :current="current" @change="change"></u-tabs>
		</view>
		<view class="reject-box" v-if="form.status===3">
			<view class="flex-align-center">
				<static-image src="/pagesA/static/img/order/icon-notice.png" width="40" height="40" margin-right="16"></static-image>
				<view class="font-s-16 fw-b">拒绝原因</view>
			</view>
			<view class="color-666 line-height-44 mar-t-15">{{form.approveRemark || '暂无拒绝原因'}}</view>
		</view>
		<view class="current-box" v-if="current===0">
			<image src="../static/img/quota/weixin-1.png" mode="widthFix"></image>
			<image src="../static/img/quota/weixin-2.png" mode="widthFix"></image>
			<image src="../static/img/quota/weixin-3.png" mode="widthFix"></image>
			<view class="copy-box">
				<view class="">{{email}}</view>
				<view class="color-blue" @click="$common.setClipboardData(email)">复制</view>
			</view>
		</view>
		<view class="current-box" v-if="current===1">
			<image src="../static/img/quota/zfb-1.png" mode="widthFix"></image>
			<image src="../static/img/quota/zfb-2.png" mode="widthFix"></image>
			<image src="../static/img/quota/zfb-3.png" mode="widthFix"></image>
			<image src="../static/img/quota/zfb-4.png" mode="widthFix"></image>
			<image src="../static/img/quota/zfb-5.png" mode="widthFix"></image>
			<view class="copy-box">
				<view class="">{{email}}</view>
				<view class="color-blue" @click="$common.setClipboardData(email)">复制</view>
			</view>
		</view>
		<footer-btn v-if="form.status!==2">
			<u-button v-if="form.status===1" hover-class="none" shape="circle" type="primary" :custom-style="{background:'#F5F7FA',color:'#999999',fontSize:'32rpx',fontWeight:'bold',height:'90rpx',letterSpacing: '8rpx'}">正在审核中</u-button>
			<u-button v-else shape="circle" @click="confirm()" type="primary" :custom-style="{background:'#1F78FF',fontSize:'32rpx',fontWeight:'bold',height:'90rpx',letterSpacing: '8rpx'}">我已发送至邮箱</u-button>
		</footer-btn>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current:0,
				email: '',
				form:{},
				tabList: [{
					name: '微信账单'
				}, {
					name: '支付宝账单'
				}],
			}
		},
		onLoad() {
			this.getDetail()
		},
		methods: {
			change(index){
				this.current = index
			},
			getDetail() {
				this.$request({
					url: '/orderInfoIncrIncome/incrIncomeProveDetail',
					method: 'get',
				}).then(res => {
					this.form = res.data || {}
				})
				this.$request({
					url: '/system/config/configKey/income_certificate_email',
					method: 'get'
				}).then(res => {
					this.email = res.msg
				})
			},
			confirm(){
				uni.showLoading({ mask:true })
				this.$request({
					url: '/orderInfoIncrIncome/saveIncrIncomeProve',
					method: 'post',
					data: this.form
				}).then(res => {
					this.$u.toast('提交成功');
					this.$common.handleSuccess()
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.income-certificate {
		padding: 96rpx 0 48rpx;
		image{
			width: 100%;
			vertical-align: middle;
		}
		.reject-box{
			width: 702rpx;
			margin: 24rpx auto;
		}
		.current-box{
			position: relative;
			.copy-box{
				display: flex;
				align-items: center;
				justify-content: space-between;
				width: 582rpx;
				height: 72rpx;
				background: #F5F7FA;
				border-radius: 16rpx;
				position: absolute;
				top: 368rpx;
				left: 120rpx;
				padding: 0 24rpx;
				font-size: 24rpx;
			}
		}
	}
</style>
